package com.quanyan.authority.web;

import com.quanyan.api.APIResponse;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by Administrator on 2016/8/4.
 */
@RestController
public abstract class BaseController<T> {

    /**
     * 增加
     * @param t
     * @return
     */
    public abstract APIResponse save(T t,BindingResult bindingResult);

    /**
     * 分页查询
     * @param t
     * @return
     */
    public abstract APIResponse query(T t);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    public abstract APIResponse queryById(Map map);

    /**
     * 修改
     * @param t
     * @return
     */
    public abstract APIResponse update(T t);

    /**
     * 删除
     * @param id
     * @return
     */
    public abstract APIResponse deleteById(Map map);





}
